<!DOCTYPE html>
<html class="ui-page-login">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>赛事</title>
    <link href="../../css/mui.css" rel="stylesheet"/>
    <link href="../../css/reset.css" rel="stylesheet"/>
    <link rel="stylesheet" href="../../css/iconfont.css" />
    <link rel="stylesheet" href="../../css/dashi.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="full-screen" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="format-detection" content="address=no">
    <script src="../../js/jquery.min.js"></script>
    <script type="text/javascript">
        var docEl = document.documentElement;
        var clientWidth = docEl.clientWidth;
        docEl.style.fontSize = (clientWidth / 10) + 'px';
        $(document).ready(function () {
            (function (doc, win) {
                var docEl = doc.documentElement,
                        resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
                        recalc = function () {
                            var clientWidth = docEl.clientWidth;
                            docEl.style.fontSize = (clientWidth / 10) + 'px';
                        };

                if (!doc.addEventListener) return;
                win.addEventListener(resizeEvt, recalc, false);
                doc.addEventListener('DOMContentLoaded', recalc, false);
            })(document, window);
        });
    </script>
</head>

<body>
<article class="mui-content saishi">
	<div class="saishi-main">
		<ul class="saishi-zong">
			<!--<li class="saishi-fen">-->
				<!--<a class="saishi-go" href="saishi_detail.html">-->
					<!--<div class="saishi-fen-top">-->
					<!--<img class="saishi-fen-top-tu" src="../../img/dashi.jpg">-->
					<!--<p class="saishi-fen-top-tit">塔罗斯大师杯家酿啤酒大奖赛北京站区</p>-->
					<!--</div>-->
					<!--<div class="saishi-fen-down">-->
						<!--<span class="saishi-fen-down-status">进行中</span>-->
						<!--<div class="saishi-fen-down-right">-->
							<!--<span class="saishi-fen-down-dizhi">-->
								<!--<span class="iconfont icon-didian"></span>-->
								<!--<span class="saishi-fen-down-dizhi-word">北京</span>-->
							<!--</span>-->
							<!--<span class="saishi-fen-down-time">-->
								<!--<span class="iconfont icon-shijian" ></span>-->
								<!--<span class="saishi-fen-down-time-word">2017-02-18</span>-->
							<!--</span>-->
						<!--</div>						-->
					<!--</div>-->
				<!--</a>-->
				<!---->
			<!--</li>-->
		</ul>
	</div>
</article>
<nav class="mui-bar mui-bar-tab">
     <a class="tabyemian-go tab-active" href="#">
     	<span class="iconfont icon-saishi"></span>
     	<span class="tabyyemian-word">赛事</span>
     </a> 
      <a class="tabyemian-go " href="zixun.html">
     	<span class="iconfont icon-zixun" ></span>
     	<span class="tabyyemian-word">资讯</span>
     </a>
      <a class="tabyemian-go" href="index.html">
     	<span class="iconfont icon-dashibei"></span>
     	<span class="tabyyemian-word">主办方</span>
     </a>
      <a class="tabyemian-go" href="wode.html">
     	<span class="iconfont icon-wode"></span>
     	<span class="tabyyemian-word">我的</span>
     </a>
</nav>
<script src="../../js/jquery-2.1.1.min.js" ></script>
<script src="../../js/mui.min.js"></script>
<script src="../../js/main.js"></script>
<script>
    $(function(){
        var user =   getUserInfo();
        var user_token = user.userToken;
        var event = {
            getList: function () {
                var data = {
                    apiCode: '/Match/matchList',
                    event_id:1,
                    page:1,
                    user_token:user_token
                };
                http(data, function (responed) {
                  var  goodinfo = responed.data;
                            $.each(goodinfo, function (i, n) {
                                var temp = "";
                                temp +=   '<li class="saishi-fen">'+
                                        '<a class="saishi-go" href="saishi_detail.html?match_id='+n.match_id+'">'+
                                        '<div class="saishi-fen-top">'+
                                        '<img class="saishi-fen-top-tu" src="'+n.match_img+'">'+
                                        '<p class="saishi-fen-top-tit">'+ n.match_title+'</p>'+
                                        ' </div>'+
                                        '<div class="saishi-fen-down">'+
                                        '<span class="saishi-fen-down-status">进行中</span>'+
                                        '<div class="saishi-fen-down-right">'+
                                        '<span class="saishi-fen-down-dizhi">'+
                                        '<span class="iconfont icon-didian"></span>'+
                                        '<span class="saishi-fen-down-dizhi-word">'+ n.match_address+'</span>'+
                                        '</span>'+
                                        '<span class="saishi-fen-down-time">'+
                                        '<span class="iconfont icon-shijian" ></span>'+
                                        '<span class="saishi-fen-down-time-word">'+ n.apply_start_time+'</span>'+
                                        '</span>'+
                                        '</div>'+
                                        '</div>'+
                                        '</a>'+
                                        '</li>';
                                $('.saishi-zong').append(temp);
                                var endtime = (new Date(n.apply_end_time * 1000));
                                var nowTime = new Date();
                                var intDiff=(endtime.getTime()-nowTime);
//                                console.log(intDiff);
//                                if (intDiff>0) {
//                                    $('.saishi-fen-down-status').text(n.match_start_time);
//                                    $('.saishi-go').attr('href','saishi_detail.html?id='+ n.match_id+'');

//                                }else{
//                                    $('.saishi-fen-down-status').text(n.match_end_time);
//                                    $('.saishi-go').attr('href','#');
//                                }
                            });
                });
            },
        }
        event.getList();
    })
</script>
</body>
</html>

